<?php
	if(!(LoggedIn()))
	{
		include "/php/post/login.php";
		
		if($loginError != "")
		{
			$loginError = "<li class='loginError'>".$loginError."</li>";
			$rememberedEmail = htmlentities($_POST["email"]);
		}
		else
		{
			$rememberedEmail = "";
		}
?>

<div id="loginContainer">
	<h2>Login</h2>
	<div id="formHolder">
		<form action="" method="POST">
			<table>
				<tr>
					<td colspan="2"><?php echo $loginError; ?></td>
				</tr>
				<tr>
					<td style="width:100px;">Email address:</td><td><input name="email" type="text" value="<?php echo $rememberedEmail; ?>" /></td>
				</tr>
				<tr>
					<td style="width:100px;">Password:</td><td><input name="password" type="password" /></td>
				</tr>
				<tr>
					<td>&nbsp;</td><td><input type="checkbox" name="remember" /> Keep me logged in</td>
				</tr>
				<tr>
					<td>&nbsp;</td><td style="padding-top:10px;"><input type="submit" name="submit" value="Login" class="button" /> or <b><a href="/rl.php?p=register">Register</a></b></td>
				</tr>
				<tr>
					<td>&nbsp;</td><td style="padding-top:10px;"><a href="/rl.php?p=forgot">Forgot your password?</a></td>
				</tr>
			</table>
		</form>
	</div>
</div>
<?php
	}
	else
	{
		header("Location:/");
	}
?>